package swu.cx.retrofittest


import okhttp3.MultipartBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

const val API_KEY="c68586aea770073872b1778e3698efbc"
interface NetWorkAPI {
    @GET("a.php")
    fun getJsonTestString(): Call<ResponseBody>

    @GET("query")
    fun getWeather(@Query("city") City:String,@Query("key") key:String = API_KEY):Call<Weather>

    @GET("login/login.php")
    fun getMultyParamsLogin(@QueryMap params:Map<String,String>):Call<ResponseBody>

    @FormUrlEncoded
    @POST("login/login.php")
    fun getPostFormLogin(@Field("user_name") name:String,@Field("user_pwd") pwd:String):Call<ResponseBody>

    @Multipart
    @POST("upload.php")
    fun getPostFile(@Part file:MultipartBody.Part):Call<ResponseBody>

    @GET("girl1.jpg")
    fun getDownLoadPic():Call<ResponseBody>

    @GET
    fun dynamicGetWeather(@Url url:String):Call<Weather>

    @GET
    fun getJsonTestString2(@Url url:String): Call<ResponseBody>
}